
Ext.onReady(function(){
    Ext.QuickTips.init();

   var menu1 = Ext.create('Ext.menu.Menu', {
        id: 'Menu1',
        
        items: [{
               text: 'USUARIOS', iconCls: 'blist', 						
				    menu: [	{text: 'GESTION USUARIOS',iconCls: 'bsubmenu',handler: onUsuarios}
				]
		
           	},
		{
               text: 'ROLES', iconCls: 'blist', handler: onItemClick2
           	},
		{
               text: 'PERMISOS', iconCls: 'blist',
           	},
		{
               text: 'PROYECTOS', iconCls: 'blist',  handler: onItemClick3
           	},
		{
               text: 'FASES', iconCls: 'blist',
           	},
		{
               text: 'TIPOS DE ITEM', iconCls: 'blist',
           	},
		
     	]
    });


   var menu2 = Ext.create('Ext.menu.Menu', {
        id: 'Menu2',
        
        items: [{
               text: 'ITEMS',
				iconCls: 'blist',
               menu: [	{text: 'CREAR',},
					{text: 'MODIFICAR',},
					{text: 'ELIMINAR',},
					{text: 'BUSCAR',}
				]
           	},

		{text: 'CALCULO DE IMPACTO',iconCls: 'blist'}
		
     	]
    });

    var menu3 = Ext.create('Ext.menu.Menu', {
        id: 'Menu3',
        
        items: [{
               text: 'LINEAS BASES',
		iconCls: 'blist',
               menu: [	{text: 'GENERAR',},
			{text: 'ROMPER',},
			{text: 'CERRAR',},
			{text: 'BUSCAR',}
		]
           	}
		
     	]
    });
   
    var tb = Ext.create('Ext.toolbar.Toolbar');
    tb.suspendLayout = true;
    tb.render('toolbar');

    tb.add({
            text:'ADMINISTRACION',
            iconCls: 'bmenu', 
            menu: menu1 
        }, {
            text:'DESARROLLO',
            iconCls: 'bmenu',  
            menu: menu2  
        },
	{
            text:'GESTION DE CONFIGURACION',
            iconCls: 'bmenu',  
            menu: menu3  
        }
	);

    function onUsuarios(){
        window.location = "usuarios";
    }
    
    
    function onItemClick2(){
        window.location = "roles";
    }   
     
    function onItemClick3(){
        window.location = "proyectos";
    } 

});

